<%@ page language="java" import="java.util.*, com.zjut.an.util.tools.*,com.zjut.an.util.system.*,
com.zjut.an.config.dao.*,com.zjut.an.config.manager.*" pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>layui</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link rel="stylesheet" type="text/css" href="../plugins/layuiadmin/layui/css/layui.css" media="all">
	<link rel="stylesheet" type="text/css" href="common/bootstrap/css/bootstrap.css" media="all">
	<link rel="stylesheet" type="text/css" href="common/global.css" media="all">
	<link rel="stylesheet" type="text/css" href="css/personal.css" media="all">
	<script src="js/city.js"></script>
  <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<%
AnConfigManager cmanager = (AnConfigManager) SpringContextUtil.getBean("AnConfigManager");

%>
<form id="add" class="layui-form" action="">  
  <div class="layui-form-item">
    <div class="layui-inline">
	    <label class="layui-form-label">图片格式</label>
	    <div class="layui-input-block">
	      	<select name="tpgs" id="tpgs" lay-search>
	    		  <option value="jpg"/>jpg </option>
				  <option value="gif"/>gif </option>
			</select>
	    </div>
    </div>
  </div>
  
  
		
  <div class="layui-form-item">
    <div class="layui-input-block">
	  	
        <button type="button" class="layui-btn" id="excelupload"><i class="layui-icon"></i>导入Zip</button>      
      	<button id="btnUpload" class="layui-btn" lay-filter="demo1">立即提交</button>
    </div>
  </div>
</form>
<iframe id="rfFrame" name="rfFrame" src="about:blank" style="display:none;"></iframe> 

<p class="layui-elem-quote">请使用zip后缀的压缩文件上传</p> 
          
<script type="text/javascript" src="../plugins/layuiadmin/layui/layui.js"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>

layui.use(['form', 'jquery','upload'], function(){
  var $ = layui.jquery
  ,upload = layui.upload;
  var form = layui.form
  ,layer = layui.layer
  ,$ = layui.$;
  
  $("#add").attr("target", "rfFrame");
  var load;
//执行实例
  var uploadInst = upload.render({
      elem: '#excelupload'                //绑定元素
      , async: false
      , url: '../studentKSZPZipUpdateDatas.action'      //上传接口
      //*********************传输限制
      , exts: 'zip|'        //可传输文件的后缀
      , accept: 'file'              //video audio images
      //****************传输操作相关设置
      , data: { Parm1: "hello", Parm2: "world" }    //额外传输的参数
      , headers:{token:'sasasasa'}                   //额外添加的请求头
      , auto: false                                 //自动上传,默认是打开的
      , bindAction: '#btnUpload'                    //auto为false时，点击触发上传
      , multiple: false                             //多文件上传
      //, number: 100                               //multiple:true时有效
      ,before: function () {
    	 load=showLoad();
         this.data = {
         }
       }
      , done: function (res) {                      //传输完成的回调
          console.log(res)
          console.log(res.msg)
          layer.close(load);
          layer.close(layer.index);
          window.parent.location.reload();
      }
      , error: function () {                         //传输失败的回调
          //请求异常回调
    	  layer.alert('上传失败！');
      }
  });
});
function showLoad() {
    return layer.msg('拼命执行中...', {icon: 16,shade: [0.5, '#f5f5f5'],scrollbar: false,offset: 'auto', time:100000});
}
</script>
</body>
</html>